package com.example.studentregistration.mapper;

import com.example.studentregistration.pojo.Reporting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ReportingMapper {

    int insertReporting(Reporting reporting);// 新增：返回 int 受影响行数

    int updateReporting(Reporting reporting);// 修改：动态更新：只更新非空字段，update_time = now()

    int deleteReporting(@Param("id") Long id);// 物理删除：按主键

    List<Reporting> queryAllReporting();// 查询所有 导出：全表查，用于 Hutool 写 Excel

    Reporting queryReportingById(@Param("id") Long id);// 查询单个

    /* 分页 + 条件（可按状态、姓名、学号、班级、楼宇、缴费状态）*/
    List<Reporting> queryReportingPage(@Param("status") String status,
                                       @Param("name") String name,
                                       @Param("studentNo") String studentNo,
                                       @Param("className") String className,
                                       @Param("buildingName") String buildingName,
                                       @Param("isPaid") Integer isPaid);
}